<html>
<title>defrag</title>
<body>
<h1>defrag</h1>
Optimises a disk by defragmenting the file system.
<pre>
   <b>defrag</b> [/C] [drive:] [{/F|/U}] [/S<i>order</i>[-]] [/B] [/X] [/A] [/FO]
</pre>
<h2>Options</h2>
<pre>
   <b>drive:</b>
   This is the drive letter of the drive you wish to defragment. For instance:
          defrag c:

   <b>/C</b>
   Defrag will not use its menu-driven user interface if you use this option. It
   will communicate through the command line instead.
   You must use the <b>[drive:]</b> option, as described above, when you use
   the <b>/C</b> switch.

   <b>/F</b>
   With this option, defrag will perform a full optimisation by making sure
   that all files are at the beginning of the disk, with no gaps in between.

   <b>/U</b>
   With this option, defrag will unfragment the files, but gaps may be left
   between files.

   <b>/FF</b>
   Fully optimize the drive, moving all files first.

   <b>/DF</b>
   Fully optimize the drive, moving all directories first.

   <b>/FD</b>
   Fully optimize the drive, moving all files of the same directory together.
   
   <b>/S<i>order</i>[-]</b>
   Defrag will sort files into the given <i>order</i>:
             N  by Name (alphabetic)            E by Extension (alphabetic)
             D  by Date & time (earliest first) S by Size (smallest first)
   Postfix the <i>order</i> with a hyphen <b>-</b> to sort descending.

   <b>/B</b>
   Reboots the computer after defrag completes the optimisation.

   <b>/X</b>
   Forces defrag to exit as soon as it completes the optimisation.

   <b>/A</b>
   With this option, defrag will give an audible warning before taking action.

   <b>/FO:</b>
   For use with the <b>/C</b> option, this tells defrag to give a more full
   output of information.
</pre>
<h2>What is disk fragmentation?</h2>
When files are deleted, or made smaller, this leaves gaps in the data stored on the disk.
If a file is created, or increases in size, it will go in the gaps, but if this space isn't
big enough, the file will be continued elsewhere on the disk. After many such
operations the file data can become very scattered. This fragmentation process slows down file
access.
<p>Fragmentation is a normal process on DOS disks.
<p>Defrag does not yet support FAT32 disks.
<h2>When should I use defrag?</h2>
Use defrag occasionally, or after you have performed a very large file restructuring task.
<hr>
<address>
<b>Copyright &copy; 2003-4 <a href="mailto:worldwiderob@yahoo.co.uk">Rob Platt</a></b>
<br>
This file forms part of The FreeDOS HTML Help Documentation, and is covered
under its terms: see <a href="../index.htm">index.htm</a><br>
</address>
</body>
</html>
